home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / ioctl.z / ioctl
Encoding:
Text File  |  2002-10-03  |  7.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. iiiiooooccccttttllll((((2222))))                                                              iiiiooooccccttttllll((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _iiii_oooo_cccc_tttt_llll - control device
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_iiii_oooo_cccc_tttt_llll_...._hhhh_>>>>   /* _SGIAPI FIO* functions */
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_rrrr_oooo_pppp_tttt_ssss_...._hhhh_>>>>     /* STREAMS functions */
  15.  
  16.      _iiii_nnnn_tttt _iiii_oooo_cccc_tttt_llll _((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _iiii_nnnn_tttt _rrrr_eeee_qqqq_uuuu_eeee_ssss_tttt_,,,, _...._...._...._))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _iiii_oooo_cccc_tttt_llll performs a variety of control functions on devices and STREAMS.
  20.      For non-STREAMS files, the functions performed by this call are device-
  21.      specific control functions.  _r_e_q_u_e_s_t and an optional third argument with
  22.      varying type are passed to the file designated by _f_i_l_d_e_s and are
  23.      interpreted by the device driver.
  24.  
  25.      For STREAMS files, specific functions are performed by the _iiii_oooo_cccc_tttt_llll call as
  26.      described in _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7).  Argument types and other _r_e_q_u_e_s_t-specific
  27.      information found in _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7) take precedence over information found
  28.      in this manual page.
  29.  
  30.      _f_i_l_d_e_s is an open file descriptor that refers to a device.  _r_e_q_u_e_s_t
  31.      selects the control function to be performed and depends on the device
  32.      being addressed.  Many devices do not require that the device be opened
  33.      in a writable mode in order to successfully perform _i_o_c_t_l_s that change
  34.      the device parameters, or even the contents of the media for devices with
  35.      permanent storage.  _a_r_g represents a third argument that has additional
  36.      information that is needed by this specific device to perform the
  37.      requested function.  The data type of _a_r_g depends upon the particular
  38.      control request, but it is generally either an _iiii_nnnn_tttt or a pointer to a
  39.      device-specific data structure.
  40.  
  41.      In addition to device-specific and STREAMS functions, generic functions
  42.      are provided by more than one device driver, for example, the general
  43.      terminal interface [see _tttt_eeee_rrrr_mmmm_iiii_oooo(7)].
  44.  
  45.      The following operations are generally available on all descriptors [see
  46.      _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7)]:
  47.  
  48.      _FFFF_IIII_OOOO_NNNN_BBBB_IIII_OOOO        Enables or disables non-blocking I/O on _f_i_l_d_e_s.  _a_r_g is a
  49.                     pointer to an iiiinnnntttt whose value should be 1 to enable non-
  50.                     blocking I/O or 0 to disable non-blocking I/O.  This
  51.                     operation is not currently supported on old-style (non-
  52.                     STREAMS) pipes.
  53.  
  54.      _FFFF_IIII_OOOO_NNNN_RRRR_EEEE_AAAA_DDDD       Returns the number of bytes of data currently available to
  55.                     be read on _f_i_l_d_e_s.  _a_r_g is a pointer to a ssssiiiizzzzeeee____tttt into
  56.                     which the byte-count will be stored unless the ioctl is
  57.                     called on a _ssss_oooo_cccc_kkkk_eeee_tttt.  For _ssss_oooo_cccc_kkkk_eeee_tttt_ssss, the value returned is an
  58.                     iiiinnnntttt and _a_r_g is a pointer to an iiiinnnntttt.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiooooccccttttllll((((2222))))                                                              iiiiooooccccttttllll((((2222))))
  71.  
  72.  
  73.  
  74.      _iiii_oooo_cccc_tttt_llll fails for any type of file if one or more of the following are
  75.      true:
  76.  
  77.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS         The type of access requested on the file designated by
  78.                     _f_i_l_d_e_s is denied.
  79.  
  80.      _EEEE_BBBB_AAAA_DDDD_FFFF          _f_i_l_d_e_s is not a valid open file descriptor.
  81.  
  82.      _EEEE_NNNN_OOOO_TTTT_TTTT_YYYY         _f_i_l_d_e_s is not associated with a device driver that accepts
  83.                     control functions.
  84.  
  85.      _EEEE_IIII_NNNN_TTTT_RRRR          A signal was caught during the _iiii_oooo_cccc_tttt_llll system call.
  86.  
  87.      _iiii_oooo_cccc_tttt_llll also fails if the device driver detects an error.  In this case,
  88.      the error is passed through _iiii_oooo_cccc_tttt_llll without change to the caller.  A
  89.      particular driver might not have all of the following error cases.  Under
  90.      the following conditions, requests to device drivers may fail and set
  91.      _eeee_rrrr_rrrr_nnnn_oooo to:
  92.  
  93.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT         _r_e_q_u_e_s_t requires a data transfer to or from a buffer
  94.                     pointed to by _a_r_g, but some part of the buffer is outside
  95.                     the process's allocated space.
  96.  
  97.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _r_e_q_u_e_s_t or _a_r_g is not valid for this device.
  98.  
  99.      _EEEE_IIII_OOOO            Some physical I/O error has occurred.
  100.  
  101.      _EEEE_NNNN_XXXX_IIII_OOOO          The _r_e_q_u_e_s_t and _a_r_g are valid for this device driver, but
  102.                     the service requested can not be performed on this
  103.                     particular subdevice.
  104.  
  105.      _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK        _f_i_l_d_e_s is on a remote machine and the link to that machine
  106.                     is no longer active.
  107.  
  108.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT      _f_i_l_d_e_s is on a remote machine which is not available [see
  109.                     _iiii_nnnn_tttt_rrrr_oooo(2)].
  110.  
  111.      STREAMS errors are described in _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7).
  112.  
  113. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  114.      _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7), _tttt_eeee_rrrr_mmmm_iiii_oooo(7)
  115.  
  116. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  117.      Upon successful completion, the value returned depends upon the device
  118.      control function, but must be a non-negative integer. Otherwise, a value
  119.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.